package org.anti996.bankms.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.anti996.bankms.util.IDUtil;

import java.sql.Timestamp;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Account {
    private String username;
    private String passwd;
    private String name;
    private String idnumber;
    private String hometown;
    private String phone;
    private Timestamp account_open;
    private Timestamp account_close;

    public static String describe(Account account) {
        // TODO 调整输出
        return String.format("用户%s：\n姓名：%s，性别：%s，年龄：%d，身份证号：%s，籍贯：%s，预留电话号码：%s，账户开通于%s",
                account.getUsername(), account.getName(), IDUtil.judgeGender(account.idnumber),
                IDUtil.countAge(account.idnumber), account.getIdnumber(), account.getHometown(), account.getPhone(),
                account.getAccount_open());
    }

}
